
using System;
using System.Collections;
using System.Collections.Generic;
using System.Reflection;
using UnityEngine;

internal class NetworkingPeer : LoadbalancingPeer
{
	public string mAppVersion;

	private string mAppId;

	private string playername = string.Empty;


	private JoinType mLastJoinType;

	private bool mPlayernameHasToBeUpdated;

	public bool hasSwitchedMC;

	public bool requestSecurity = true;

	private Dictionary<Type, List<MethodInfo>> monoRPCMethodsCache = new Dictionary<Type, List<MethodInfo>>();

	public static bool UsePrefabCache = true;

	public static Dictionary<string, GameObject> PrefabCache = new Dictionary<string, GameObject>();

	public Dictionary<string, RoomInfo> mGameList = new Dictionary<string, RoomInfo>();

	public RoomInfo[] mGameListCopy = new RoomInfo[0];

	public bool insideLobby;

	public Dictionary<int, GameObject> instantiatedObjects = new Dictionary<int, GameObject>();

	private HashSet<int> allowedReceivingGroups = new HashSet<int>();

	private HashSet<int> blockSendingGroups = new HashSet<int>();

	protected internal short currentLevelPrefix;

	private readonly Dictionary<string, int> rpcShortcuts;

	public bool IsInitialConnect;

	public string NameServerAddress = "ns.exitgamescloud.com:5058";

	private bool didAuthenticate;

	private int friendListTimestamp;

	private bool isFetchingFriends;

	private Dictionary<int, object[]> tempInstantiationData = new Dictionary<int, object[]>();

	protected internal bool loadingLevelAndPausedNetwork;

	protected internal const string CurrentSceneProperty = "curScn";

	public AuthenticationValues CustomAuthenticationValues
	{
		get;
		set;
	}

	public string MasterServerAddress
	{
		get;
		protected internal set;
	}

	public string PlayerName
	{
		get
		{
			return playername;
		}
		set
		{

		}
	}

	public PeerState State
	{
		get;
		internal set;
	}

	public Room mCurrentGame
	{
		get
		{
			if (mRoomToGetInto != null && mRoomToGetInto.isLocalClientInside)
			{
				return mRoomToGetInto;
			}
			return null;
		}
	}

	internal Room mRoomToGetInto
	{
		get;
		set;
	}

	internal RoomOptions mRoomOptionsForCreate
	{
		get;
		set;
	}

	internal TypedLobby mRoomToEnterLobby
	{
		get;
		set;
	}

	public string mGameserver
	{
		get;
		internal set;
	}

	public int mQueuePosition
	{
		get;
		internal set;
	}

	public TypedLobby lobby
	{
		get;
		set;
	}

	public int mPlayersOnMasterCount
	{
		get;
		internal set;
	}

	public int mGameCount
	{
		get;
		internal set;
	}

	public int mPlayersInRoomsCount
	{
		get;
		internal set;
	}

	protected internal ServerConnection server
	{
		get;
		private set;
	}

	public bool IsUsingNameServer
	{
		get;
		protected internal set;
	}

	public string[] AvailableRegions
	{
		get;
		protected internal set;
	}

	public string[] AvailableRegionsServers
	{
		get;
		protected internal set;
	}

	public string CloudRegion
	{
		get;
		protected internal set;
	}

	public bool IsAuthorizeSecretAvailable => false;

	protected internal int FriendsListAge => (!isFetchingFriends && friendListTimestamp != 0) ? (Environment.TickCount - friendListTimestamp) : 0;

	/* public NetworkingPeer(IPhotonPeerListener listener, string playername, ConnectionProtocol connectionProtocol)
		: base(listener, connectionProtocol)
	{
		UnityEngine.Debug.Log("Using class SocketUdpNativeDynamic");
		base.SocketImplementation = typeof(SocketUdpNativeDynamic);
		base.Listener = this;
		lobby = TypedLobby.Default;
		externalListener = listener;
		PlayerName = playername;
		mLocalActor = new PhotonPlayer(isLocal: true, -1, this.playername);
		AddNewPlayer(mLocalActor.ID, mLocalActor);
		rpcShortcuts = new Dictionary<string, int>(PhotonNetwork.PhotonServerSettings.RpcList.Count);
		for (int i = 0; i < PhotonNetwork.PhotonServerSettings.RpcList.Count; i++)
		{
			string key = PhotonNetwork.PhotonServerSettings.RpcList[i];
			rpcShortcuts[key] = i;
		}
		State = global::PeerState.PeerCreated;
	} */


}
